package com.changwu.cwbase.ui.adapter;

import android.support.v4.app.Fragment;

import com.aspsine.fragmentnavigator.FragmentNavigatorAdapter;
import com.changwu.cwbase.temples.fragment.TempleFragment;
import com.changwu.cwbase.ui.fragment.UserCenterFragment;

/**
 * Created by aspsine on 16/3/31.
 */
public class MainFragmentAdapter implements FragmentNavigatorAdapter {

    private static final String TABS[] = {"首页", "要省钱", "医友圈", "全部分类", "购物车", "我的"};

    @Override
    public Fragment onCreateFragment(int position) {
        if (position == 0) {
            return TempleFragment.newInstance();
        } else if (position == 1) {
            return TempleFragment.newInstance();
        } else if (position == 2) {
            return UserCenterFragment.newInstance();
        }else {
            return TempleFragment.newInstance();
        }
    }

    @Override
    public String getTag(int position) {
        return TABS[position];
    }

    @Override
    public int getCount() {
        return TABS.length;
    }
}
